package com.lsl.bhllserver.service.product;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.lsl.bhllserver.dao.ProductDAO;
import com.lsl.bhllserver.entity.Product;

@Service
public class ProductService {

    @Autowired
    protected ProductDAO productDAO;

    public List<Product> searchProduct(String[] keywords) {
        return productDAO.findByKeywords(keywords);
    }

    // @Cacheable(value = "product", key = "#id")
    public Product getProductByID(Integer id) {
        return productDAO.findByID(id.toString());
    }
    
}
